// @ts-ignore
import { api } from '@/utils/api';

/** 清空所有消息 POST /sysMessageRecord/clear */
export async function sysMessageRecordClear(
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function sysMessageRecordClear(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function sysMessageRecordClear(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function sysMessageRecordClear(options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/sysMessageRecord/clear`, {
      method: 'POST',
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/sysMessageRecord/clear`, {
    method: 'POST',
    ...(options || {})
  });
}

/** 删除系统消息记录数据 POST /sysMessageRecord/delete */
export async function sysMessageRecordDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function sysMessageRecordDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function sysMessageRecordDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function sysMessageRecordDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/sysMessageRecord/delete`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/sysMessageRecord/delete`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取系统消息记录VO数据 POST /sysMessageRecord/getVo */
export async function sysMessageRecordGetVo(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultSysMessageRecordResp>;

export async function sysMessageRecordGetVo(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultSysMessageRecordResp>>;

export async function sysMessageRecordGetVo(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultSysMessageRecordResp>;

export async function sysMessageRecordGetVo(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultSysMessageRecordResp>(`/app/sysMessageRecord/getVo`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultSysMessageRecordResp>(`/app/sysMessageRecord/getVo`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 全部标记为已读 POST /sysMessageRecord/markAllRead */
export async function sysMessageRecordMarkAllRead(
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function sysMessageRecordMarkAllRead(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function sysMessageRecordMarkAllRead(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function sysMessageRecordMarkAllRead(options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/sysMessageRecord/markAllRead`, {
      method: 'POST',
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/sysMessageRecord/markAllRead`, {
    method: 'POST',
    ...(options || {})
  });
}

/** 获取系统消息记录分页数据 POST /sysMessageRecord/page */
export async function sysMessageRecordPage(
  body: BASE.SysMessageRecordQuery,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultIPageSysMessageRecordEntity>;

export async function sysMessageRecordPage(
  body: BASE.SysMessageRecordQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultIPageSysMessageRecordEntity>>;

export async function sysMessageRecordPage(
  body: BASE.SysMessageRecordQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultIPageSysMessageRecordEntity>;

export async function sysMessageRecordPage(
  body: BASE.SysMessageRecordQuery,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultIPageSysMessageRecordEntity>(`/app/sysMessageRecord/page`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultIPageSysMessageRecordEntity>(`/app/sysMessageRecord/page`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 读取消息 POST /sysMessageRecord/read */
export async function sysMessageRecordRead(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function sysMessageRecordRead(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function sysMessageRecordRead(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function sysMessageRecordRead(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/sysMessageRecord/read`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/sysMessageRecord/read`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 未读消息数量 POST /sysMessageRecord/unreadCount */
export async function sysMessageRecordUnreadCount(
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultInteger>;

export async function sysMessageRecordUnreadCount(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultInteger>>;

export async function sysMessageRecordUnreadCount(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultInteger>;

export async function sysMessageRecordUnreadCount(options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultInteger>(`/app/sysMessageRecord/unreadCount`, {
      method: 'POST',
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultInteger>(`/app/sysMessageRecord/unreadCount`, {
    method: 'POST',
    ...(options || {})
  });
}
